<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Settings extends Auth_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('settings_mdl');
    }

    public function index(){
        if($_SESSION['user']['group'] != 1){
            show_404();
        }

        //获取所有数据
        $re = $this->settings_mdl->get_one();
        $this->_view('index',$re);
    }

     public function update(){
        $post = $this->input->post();
        $data = array('title'=>$post['title'],'update_time'=>time(),'status'=>$post['status']);
        $this->db->where('id',1);
        $re = $this->settings_mdl->update($data);
        if($re){
            echo 1;
        }
    }

}

/* End of file Settings.php */
/* Location: ./application/controllers/Settings.php */